import 'package:json_annotation/json_annotation.dart';

part 'room_detail.g.dart';

@JsonSerializable()
class RoomDetail {
  @JsonKey(name: "houseCode")
  String? id;
  String? title;
  String? community; // 小区

  @JsonKey(name: "description")
  String? subTitle;
  int? size;
  String? floor;
  int? price;
  String? roomType;

  @JsonKey(name: "houseImg")
  List<String>? houseImgs;
  List<String>? tags;
  List<String>? oriented;

  @JsonKey(name: "supporting")
  List<String>? applicances;

  RoomDetail({
    this.id,
    this.title,
    this.community,
    this.subTitle,
    this.size,
    this.floor,
    this.price,
    this.roomType,
    this.houseImgs,
    this.tags,
    this.oriented,
    this.applicances,
  });

  factory RoomDetail.fromJson(Map<String, dynamic> json) => _$RoomDetailFromJson(json);

  Map<String, dynamic> toJson() => _$RoomDetailToJson(this);

  RoomDetail.empty();
}

var defaultRoomDetail = RoomDetail(
  id: "1111",
  title: "整租 中山路 历史最低价",
  community: "中山花园",
  subTitle: "近地铁 附近有超市！",
  size: 100,
  floor: "高楼层",
  price: 3000,
  roomType: "三室两厅两卫",
  houseImgs: [
    "https://ww3.sinaimg.cn/large/006y8mN6ly1g6e2tdgve1j30ku0bsn75.jpg",
    "https://ww3.sinaimg.cn/large/006y8mN6ly1g6e2whp87sj30ku0bstec.jpg",
    "https://ww3.sinaimg.cn/large/006y8mN6ly1g6e2tl1v3bj30ku0bs77z.jpg",
  ],
  tags: ["近地铁", "集中供暖", "新上"],
  oriented: ["南"],
  applicances: ["衣柜", "洗衣机", "空调"],
);
